package jannex.sql;

import jannex.JannexException;
import jannex.mapping.ResultSetHandler;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.*;
import java.util.Calendar;
import java.util.Map;

public interface JxResultSet extends java.sql.ResultSet {

    // Extensions:

    <E> TypedResultSet<E> as(Class<E> elementClass) throws JannexException;

    <E> TypedResultSet<E> as(ResultSetHandler<E> handler) throws JannexException;

    <E> Fetcher<E> fetch(Class<E> elementClass) throws JannexException;

    JxResultSet subSetFromTable(String tableName);

    /**
     * First column is 1
     */
    JxResultSet subSetFrom(int... columnIndexes);

    @Override
    boolean next() throws JannexException;

    @Override
    void close() throws JannexException;

    @Override
    boolean wasNull() throws JannexException;

    @Override
    String getString(int columnIndex) throws JannexException;

    @Override
    boolean getBoolean(int columnIndex) throws JannexException;

    @Override
    byte getByte(int columnIndex) throws JannexException;

    @Override
    short getShort(int columnIndex) throws JannexException;

    @Override
    int getInt(int columnIndex) throws JannexException;

    @Override
    long getLong(int columnIndex) throws JannexException;

    @Override
    float getFloat(int columnIndex) throws JannexException;

    @Override
    double getDouble(int columnIndex) throws JannexException;

    @Override
    @Deprecated
    BigDecimal getBigDecimal(int columnIndex, int scale) throws JannexException;

    @Override
    byte[] getBytes(int columnIndex) throws JannexException;

    @Override
    Date getDate(int columnIndex) throws JannexException;

    @Override
    Time getTime(int columnIndex) throws JannexException;

    @Override
    Timestamp getTimestamp(int columnIndex) throws JannexException;

    @Override
    InputStream getAsciiStream(int columnIndex) throws JannexException;

    @Override
    @Deprecated
    InputStream getUnicodeStream(int columnIndex) throws JannexException;

    @Override
    InputStream getBinaryStream(int columnIndex) throws JannexException;

    @Override
    String getString(String columnLabel) throws JannexException;

    @Override
    boolean getBoolean(String columnLabel) throws JannexException;

    @Override
    byte getByte(String columnLabel) throws JannexException;

    @Override
    short getShort(String columnLabel) throws JannexException;

    @Override
    int getInt(String columnLabel) throws JannexException;

    @Override
    long getLong(String columnLabel) throws JannexException;

    @Override
    float getFloat(String columnLabel) throws JannexException;

    @Override
    double getDouble(String columnLabel) throws JannexException;

    @Override
    @Deprecated
    BigDecimal getBigDecimal(String columnLabel, int scale) throws JannexException;

    @Override
    byte[] getBytes(String columnLabel) throws JannexException;

    @Override
    Date getDate(String columnLabel) throws JannexException;

    @Override
    Time getTime(String columnLabel) throws JannexException;

    @Override
    Timestamp getTimestamp(String columnLabel) throws JannexException;

    @Override
    InputStream getAsciiStream(String columnLabel) throws JannexException;

    @Override
    @Deprecated
    InputStream getUnicodeStream(String columnLabel) throws JannexException;

    @Override
    InputStream getBinaryStream(String columnLabel) throws JannexException;

    @Override
    SQLWarning getWarnings() throws JannexException;

    @Override
    void clearWarnings() throws JannexException;

    @Override
    String getCursorName() throws JannexException;

    @Override
    JxResultSetMetaData getMetaData() throws JannexException;

    @Override
    Object getObject(int columnIndex) throws JannexException;

    @Override
    Object getObject(String columnLabel) throws JannexException;

    @Override
    int findColumn(String columnLabel) throws JannexException;

    @Override
    Reader getCharacterStream(int columnIndex) throws JannexException;

    @Override
    Reader getCharacterStream(String columnLabel) throws JannexException;

    @Override
    BigDecimal getBigDecimal(int columnIndex) throws JannexException;

    @Override
    BigDecimal getBigDecimal(String columnLabel) throws JannexException;

    @Override
    boolean isBeforeFirst() throws JannexException;

    @Override
    boolean isAfterLast() throws JannexException;

    @Override
    boolean isFirst() throws JannexException;

    @Override
    boolean isLast() throws JannexException;

    @Override
    void beforeFirst() throws JannexException;

    @Override
    void afterLast() throws JannexException;

    @Override
    boolean first() throws JannexException;

    @Override
    boolean last() throws JannexException;

    @Override
    int getRow() throws JannexException;

    @Override
    boolean absolute(int row) throws JannexException;

    @Override
    boolean relative(int rows) throws JannexException;

    @Override
    boolean previous() throws JannexException;

    @Override
    void setFetchDirection(int direction) throws JannexException;

    @Override
    int getFetchDirection() throws JannexException;

    @Override
    void setFetchSize(int rows) throws JannexException;

    @Override
    int getFetchSize() throws JannexException;

    @Override
    int getType() throws JannexException;

    @Override
    int getConcurrency() throws JannexException;

    @Override
    boolean rowUpdated() throws JannexException;

    @Override
    boolean rowInserted() throws JannexException;

    @Override
    boolean rowDeleted() throws JannexException;

    @Override
    void updateNull(int columnIndex) throws JannexException;

    @Override
    void updateBoolean(int columnIndex, boolean x) throws JannexException;

    @Override
    void updateByte(int columnIndex, byte x) throws JannexException;

    @Override
    void updateShort(int columnIndex, short x) throws JannexException;

    @Override
    void updateInt(int columnIndex, int x) throws JannexException;

    @Override
    void updateLong(int columnIndex, long x) throws JannexException;

    @Override
    void updateFloat(int columnIndex, float x) throws JannexException;

    @Override
    void updateDouble(int columnIndex, double x) throws JannexException;

    @Override
    void updateBigDecimal(int columnIndex, BigDecimal x) throws JannexException;

    @Override
    void updateString(int columnIndex, String x) throws JannexException;

    @Override
    void updateBytes(int columnIndex, byte[] x) throws JannexException;

    @Override
    void updateDate(int columnIndex, Date x) throws JannexException;

    @Override
    void updateTime(int columnIndex, Time x) throws JannexException;

    @Override
    void updateTimestamp(int columnIndex, Timestamp x) throws JannexException;

    @Override
    void updateAsciiStream(int columnIndex, InputStream x, int length) throws JannexException;

    @Override
    void updateBinaryStream(int columnIndex, InputStream x, int length) throws JannexException;

    @Override
    void updateCharacterStream(int columnIndex, Reader x, int length) throws JannexException;

    @Override
    void updateObject(int columnIndex, Object x, int scaleOrLength) throws JannexException;

    @Override
    void updateObject(int columnIndex, Object x) throws JannexException;

    @Override
    void updateNull(String columnLabel) throws JannexException;

    @Override
    void updateBoolean(String columnLabel, boolean x) throws JannexException;

    @Override
    void updateByte(String columnLabel, byte x) throws JannexException;

    @Override
    void updateShort(String columnLabel, short x) throws JannexException;

    @Override
    void updateInt(String columnLabel, int x) throws JannexException;

    @Override
    void updateLong(String columnLabel, long x) throws JannexException;

    @Override
    void updateFloat(String columnLabel, float x) throws JannexException;

    @Override
    void updateDouble(String columnLabel, double x) throws JannexException;

    @Override
    void updateBigDecimal(String columnLabel, BigDecimal x) throws JannexException;

    @Override
    void updateString(String columnLabel, String x) throws JannexException;

    @Override
    void updateBytes(String columnLabel, byte[] x) throws JannexException;

    @Override
    void updateDate(String columnLabel, Date x) throws JannexException;

    @Override
    void updateTime(String columnLabel, Time x) throws JannexException;

    @Override
    void updateTimestamp(String columnLabel, Timestamp x) throws JannexException;

    @Override
    void updateAsciiStream(String columnLabel, InputStream x, int length) throws JannexException;

    @Override
    void updateBinaryStream(String columnLabel, InputStream x, int length) throws JannexException;

    @Override
    void updateCharacterStream(String columnLabel, Reader reader, int length) throws JannexException;

    @Override
    void updateObject(String columnLabel, Object x, int scaleOrLength) throws JannexException;

    @Override
    void updateObject(String columnLabel, Object x) throws JannexException;

    @Override
    void insertRow() throws JannexException;

    @Override
    void updateRow() throws JannexException;

    @Override
    void deleteRow() throws JannexException;

    @Override
    void refreshRow() throws JannexException;

    @Override
    void cancelRowUpdates() throws JannexException;

    @Override
    void moveToInsertRow() throws JannexException;

    @Override
    void moveToCurrentRow() throws JannexException;

    @Override
    JxStatement getStatement() throws JannexException;

    @Override
    Object getObject(int columnIndex, Map<String, Class<?>> typeMap) throws JannexException;

    @Override
    JxRef getRef(int columnIndex) throws JannexException;

    @Override
    JxBlob getBlob(int columnIndex) throws JannexException;

    @Override
    JxClob getClob(int columnIndex) throws JannexException;

    @Override
    JxArray getArray(int columnIndex) throws JannexException;

    @Override
    Object getObject(String columnLabel, Map<String, Class<?>> typeMap) throws JannexException;

    @Override
    JxRef getRef(String columnLabel) throws JannexException;

    @Override
    JxBlob getBlob(String columnLabel) throws JannexException;

    @Override
    JxClob getClob(String columnLabel) throws JannexException;

    @Override
    JxArray getArray(String columnLabel) throws JannexException;

    @Override
    Date getDate(int columnIndex, Calendar cal) throws JannexException;

    @Override
    Date getDate(String columnLabel, Calendar cal) throws JannexException;

    @Override
    Time getTime(int columnIndex, Calendar cal) throws JannexException;

    @Override
    Time getTime(String columnLabel, Calendar cal) throws JannexException;

    @Override
    Timestamp getTimestamp(int columnIndex, Calendar cal) throws JannexException;

    @Override
    Timestamp getTimestamp(String columnLabel, Calendar cal) throws JannexException;

    @Override
    URL getURL(int columnIndex) throws JannexException;

    @Override
    URL getURL(String columnLabel) throws JannexException;

    @Override
    void updateRef(int columnIndex, java.sql.Ref x) throws JannexException;

    @Override
    void updateRef(String columnLabel, java.sql.Ref x) throws JannexException;

    @Override
    void updateBlob(int columnIndex, java.sql.Blob x) throws JannexException;

    @Override
    void updateBlob(String columnLabel, java.sql.Blob x) throws JannexException;

    @Override
    void updateClob(int columnIndex, java.sql.Clob x) throws JannexException;

    @Override
    void updateClob(String columnLabel, java.sql.Clob x) throws JannexException;

    @Override
    void updateArray(int columnIndex, java.sql.Array x) throws JannexException;

    @Override
    void updateArray(String columnLabel, java.sql.Array x) throws JannexException;

    @Override
    RowId getRowId(int columnIndex) throws JannexException;

    @Override
    RowId getRowId(String columnLabel) throws JannexException;

    @Override
    void updateRowId(int columnIndex, RowId x) throws JannexException;

    @Override
    void updateRowId(String columnLabel, RowId x) throws JannexException;

    @Override
    int getHoldability() throws JannexException;

    @Override
    boolean isClosed() throws JannexException;

    @Override
    void updateNString(int columnIndex, String nString) throws JannexException;

    @Override
    void updateNString(String columnLabel, String nString) throws JannexException;

    @Override
    void updateNClob(int columnIndex, java.sql.NClob nClob) throws JannexException;

    @Override
    void updateNClob(String columnLabel, java.sql.NClob nClob) throws JannexException;

    @Override
    JxNClob getNClob(int columnIndex) throws JannexException;

    @Override
    JxNClob getNClob(String columnLabel) throws JannexException;

    @Override
    JxSQLXML getSQLXML(int columnIndex) throws JannexException;

    @Override
    JxSQLXML getSQLXML(String columnLabel) throws JannexException;

    @Override
    void updateSQLXML(int columnIndex, java.sql.SQLXML xmlObject) throws JannexException;

    @Override
    void updateSQLXML(String columnLabel, java.sql.SQLXML xmlObject) throws JannexException;

    @Override
    String getNString(int columnIndex) throws JannexException;

    @Override
    String getNString(String columnLabel) throws JannexException;

    @Override
    Reader getNCharacterStream(int columnIndex) throws JannexException;

    @Override
    Reader getNCharacterStream(String columnLabel) throws JannexException;

    @Override
    void updateNCharacterStream(int columnIndex, Reader x, long length) throws JannexException;

    @Override
    void updateNCharacterStream(String columnLabel, Reader reader, long length) throws JannexException;

    @Override
    void updateAsciiStream(int columnIndex, InputStream x, long length) throws JannexException;

    @Override
    void updateBinaryStream(int columnIndex, InputStream x, long length) throws JannexException;

    @Override
    void updateCharacterStream(int columnIndex, Reader x, long length) throws JannexException;

    @Override
    void updateAsciiStream(String columnLabel, InputStream x, long length) throws JannexException;

    @Override
    void updateBinaryStream(String columnLabel, InputStream x, long length) throws JannexException;

    @Override
    void updateCharacterStream(String columnLabel, Reader reader, long length) throws JannexException;

    @Override
    void updateBlob(int columnIndex, InputStream inputStream, long length) throws JannexException;

    @Override
    void updateBlob(String columnLabel, InputStream inputStream, long length) throws JannexException;

    @Override
    void updateClob(int columnIndex, Reader reader, long length) throws JannexException;

    @Override
    void updateClob(String columnLabel, Reader reader, long length) throws JannexException;

    @Override
    void updateNClob(int columnIndex, Reader reader, long length) throws JannexException;

    @Override
    void updateNClob(String columnLabel, Reader reader, long length) throws JannexException;

    @Override
    void updateNCharacterStream(int columnIndex, Reader x) throws JannexException;

    @Override
    void updateNCharacterStream(String columnLabel, Reader reader) throws JannexException;

    @Override
    void updateAsciiStream(int columnIndex, InputStream x) throws JannexException;

    @Override
    void updateBinaryStream(int columnIndex, InputStream x) throws JannexException;

    @Override
    void updateCharacterStream(int columnIndex, Reader x) throws JannexException;

    @Override
    void updateAsciiStream(String columnLabel, InputStream x) throws JannexException;

    @Override
    void updateBinaryStream(String columnLabel, InputStream x) throws JannexException;

    @Override
    void updateCharacterStream(String columnLabel, Reader reader) throws JannexException;

    @Override
    void updateBlob(int columnIndex, InputStream inputStream) throws JannexException;

    @Override
    void updateBlob(String columnLabel, InputStream inputStream) throws JannexException;

    @Override
    void updateClob(int columnIndex, Reader reader) throws JannexException;

    @Override
    void updateClob(String columnLabel, Reader reader) throws JannexException;

    @Override
    void updateNClob(int columnIndex, Reader reader) throws JannexException;

    @Override
    void updateNClob(String columnLabel, Reader reader) throws JannexException;

    @Override
    <T> T getObject(int columnIndex, Class<T> type) throws JannexException;

    @Override
    <T> T getObject(String columnLabel, Class<T> type) throws JannexException;

    @Override
    <T> T unwrap(Class<T> iface) throws JannexException;

    @Override
    boolean isWrapperFor(Class<?> iface) throws JannexException;

}
